/**********************************
 * @Author: Ronnie Zhang
 * @LastEditor: Ronnie Zhang
 * @LastEditTime: 2023/12/05 21:29:51
 * @Email: zclzone@outlook.com
 * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
 **********************************/

import { request } from '@/utils'

export default {
  getTodoSaleOrder: (params = {}) => {
    const res = request.post(`/system/worktable/todo/saleOrder`, { ...params })
    return res
  },
  getTodoSaleOrder2: (params = {}) => {
    const res = request.post(`/system/worktable/todo/saleOrder2`, { ...params })
    return res
  },
  getTodoErrandOrder: _id => request.get(`/system/worktable//todo/errandOrder2`),
  // 打印订单
  printOrder: (params = {}) => {
    const res = request.post(`/system/delivery/order/print`, { ...params })
    return res
  },
  // 确认接单
  confirmOrder: (id) => {
    const res = request.get(`/system/order/confirmByOrder/${id}`)
    return res
  },
  // 制作完成
  makingCompleted: (id) => {
    const res = request.get(`/system/order/making/ok/${id}`)
    return res
  },
  // 开始配送
  startDeliver: (params = {}) => {
    const res = request.post(`/system/delivery/order/start/deliver`, { ...params })
    return res
  }, // 客户取货
  sendToErrand: (params = {}) => request.post(`/system/delivery/order/making/completed`, { ...params }), // 跑腿取货
  // 达达询价
  getDadaQueryFee: id => request.get(`/system/errand/dada/query/fee/${id}`),
  // 达达询价后确认
  getDadaQueryFeeThen: (params = {}) => request.post(`/system/errand/dada/query/then/${params.id}`, { ...params }), // 达达下单
  // 自配(自己配送)
  selfDeliver: (params = {}) => request.post(`/system/delivery/order/self/deliver`, { ...params }),
  // 获取订单
  getOrderPO: id => request.get(`/system/order/detail/${id}`),
}
